import json
import pprint

# 复杂数据结构
data = {
    "users": [
        {"name": "Alice", "age": 25, "hobbies": ["reading", "swimming"]},
        {"name": "Bob", "age": 30, "hobbies": ["gaming", "coding"]}
    ],
    "settings": {"theme": "dark", "notifications": True}
}

obj = {
    "stu":[
    {"name": "Alice", "age": 25, "hobbies": ["reading", "swimming"]},
    {"name": "Bob", "age": 30, "hobbies": ["gaming", "coding"]}
],
"a":{
    "b":{
        "c":{"d":{
            "e":1,
            "f":[
                {"x":1,"y":1},
                {"x":2,"y":2},
            ]
        }}
    }
}
}

# 普通打印（难以阅读）
print("普通打印:")
print(data)

# 使用pprint美化
print("\n使用pprint美化:")
pprint.pprint(data, width=40)

# 使用json格式化（最美观）
print("\n使用json格式化:")
print(json.dumps(data, indent=2, ensure_ascii=False))

print(json.dumps(obj, indent=4, ensure_ascii=False))
